package DBClasses;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import java.util.Calendar;
import java.util.Date;

@PersistenceCapable(identityType = IdentityType.UNSPECIFIED)
public class NewsLetter
{
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Long id;

	public Long getId()
	{
		return id;
	}

	@Persistent
	private String title;

	public String getTitle()
	{
		return title;
	}

	@Persistent
	private String text;

	public String getText()
	{
		return text;
	}

	@Persistent
	private String author;

	public String getAuthor()
	{
		return author;
	}

	@Persistent
	private Date post_date;

	public Date getPostDate()
	{
		return post_date;
	}

	@Persistent
	private String img_id;

	public String getImg()
	{
		return img_id;
	}

	public NewsLetter(String title, String text, String img_id, String author)
	{
		this.title = title;
		this.text = text;
		this.author = author;
		this.img_id = img_id;
		this.post_date = Calendar.getInstance().getTime();
	}
}
